package com.ai.module.suno.domain.vo;

import com.ai.module.suno.constant.SaveType;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: heJinQin
 * @create: 2024-04-27 01:32
 * @description:
 **/
@Data
public class SunoInfoVo {

    private String sunoId;

    private String videoUrl;

    private String audioUrl;

    private String imageUrl;

    private String imageLargeUrl;

    private Boolean isVideoPending;

    private String majorModelVersion;

    private SaveType saveType = SaveType.SUNO;

    private String expireTime;


    public static void main(String[] args) {
        String str ="{\n" +
                "       \"id\": \"a5824a91-6cec-4869-abf6-87da01e353c5\",\n" +
                "       \"video_url\": \"https://cdn1.suno.ai/a5824a91-6cec-4869-abf6-87da01e353c5.mp4\",\n" +
                "       \"audio_url\": \"https://cdn1.suno.ai/a5824a91-6cec-4869-abf6-87da01e353c5.mp3\",\n" +
                "       \"image_url\": \"https://cdn1.suno.ai/image_a5824a91-6cec-4869-abf6-87da01e353c5.png\",\n" +
                "       \"image_large_url\": \"https://cdn1.suno.ai/image_large_a5824a91-6cec-4869-abf6-87da01e353c5.png\",\n" +
                "       \"is_video_pending\": false,\n" +
                "       \"major_model_version\": \"v3\",\n" +
                "       \"model_name\": \"chirp-v3\",\n" +
                "       \"metadata\": {\n" +
                "           \"tags\": \"mellow hip hop\",\n" +
                "           \"prompt\": \"\",\n" +
                "           \"gpt_description_prompt\": null,\n" +
                "           \"audio_prompt_id\": \"b72e5b54-ba38-4e41-9788-b77d218e360a\",\n" +
                "           \"history\": [\n" +
                "               {\n" +
                "                   \"id\": \"b72e5b54-ba38-4e41-9788-b77d218e360a\",\n" +
                "                   \"continue_at\": 110.0\n" +
                "               }\n" +
                "           ],\n" +
                "           \"concat_history\": null,\n" +
                "           \"type\": \"gen\",\n" +
                "           \"duration\": 34.0,\n" +
                "           \"refund_credits\": false,\n" +
                "           \"stream\": true,\n" +
                "           \"error_type\": null,\n" +
                "           \"error_message\": null\n" +
                "       },\n" +
                "       \"is_liked\": false,\n" +
                "       \"user_id\": \"9cf1cf7d-cc58-427f-a12e-72d826ae7453\",\n" +
                "       \"display_name\": \"RedHotRiff706\",\n" +
                "       \"handle\": \"redhotriff706\",\n" +
                "       \"is_handle_updated\": false,\n" +
                "       \"is_trashed\": false,\n" +
                "       \"reaction\": null,\n" +
                "       \"created_at\": \"2024-04-24T18:18:59.067Z\",\n" +
                "       \"status\": \"complete\",\n" +
                "       \"title\": \"test-自定义\",\n" +
                "       \"play_count\": 0,\n" +
                "       \"upvote_count\": 0,\n" +
                "       \"is_public\": false\n" +
                "   }";
        SunoInfoVo jsonObject = JSONObject.parseObject(str, SunoInfoVo.class);
        SunoInfoVo sunoInfo = new SunoInfoVo();
        BeanUtils.copyProperties(jsonObject,sunoInfo);
        System.out.println("sunoInfo = " + sunoInfo);
        System.out.println("jsonObject = " + jsonObject);

    }

}
